using System;
using System.IO;
using System.Text.RegularExpressions;
using Drifter.Core;
using System.Collections.Generic;
using System.Collections;

namespace Drifter.Datasource
{

    public class MockDataSource : IDataSource
    {
        public List<FieldList> FieldListCollection;
        public bool Active { get; set; }
        public ITokenizer Tokenizer { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="MockDataSource"/> class.
        /// </summary>
        public MockDataSource()
        {
            FieldListCollection = new List<FieldList>() { 
            
                new FieldList(){
                    new FieldDef(){ Name="field1", Value="List1-Field1"},
                    new FieldDef(){ Name="field2", Value="List1-Field2"},
                    new FieldDef(){ Name="field3", Value="List1-Field3"}
                },
                new FieldList(){
                    new FieldDef(){ Name="field1", Value="List2-Field1"},
                    new FieldDef(){ Name="field2", Value="List2-Field2"},
                    new FieldDef(){ Name="field3", Value="List2-Field3"}
                },
             
                new FieldList(){
                    new FieldDef(){ Name="field1", Value="List3-Field1"},
                    new FieldDef(){ Name="field2", Value="List3-Field2"},
                    new FieldDef(){ Name="field3", Value="List3-Field3"}
                }             

            };
        }


        /// <summary>
        /// Gets the enumerator.
        /// </summary>
        /// <returns></returns>
        public IEnumerator<FieldList> GetEnumerator()
        {
            foreach (var list in this.FieldListCollection)
            {
                yield return list;
            }
        }

        /// <summary>
        /// Returns an enumerator that iterates through a collection.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection.
        /// </returns>
        IEnumerator IEnumerable.GetEnumerator()
        {
            throw new NotImplementedException();
        }
    }



}


